#ifndef __M_MqLog_H__
#define __M_MqLog_H__

#include<iostream>
#include<ctime>
namespace mqlog
{
    #define OKM 0
    #define DEBUGM 1
    #define INFOM  2
    #define ERRORM 3
    #define LOG(level,format, ...){\
            time_t t = time(nullptr);\
            struct tm* ptm = localtime(&t);\
            char str_time[32];\
            strftime(str_time,31,"%H:%M:%S",ptm);\
            const char* level_str[4] = {"OK","DEBUG","INFO","ERROR"};\
            printf("[%s] [%s] [%s:%d] " format "\n",level_str[level],str_time,__FILE__,__LINE__,##__VA_ARGS__);\
        }

    #define LOG_DEBUGM(format,...) LOG(DEBUGM,format,##__VA_ARGS__)
    #define LOG_INFOM(format,...) LOG(INFOM,format,##__VA_ARGS__)
    #define LOG_ERRORM(format,...) LOG(ERRORM,format,##__VA_ARGS__)
        
}
#endif